import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';
import {SungComponent} from './sung.component';
import {HomeComponent} from './home.component';
import {ArticlesComponent} from './articles.component';
import {ArticleListComponent} from './article-list.component';
import {HomeMenuComponent} from './home-menu.component';
import { TinymceEditorComponent } from './tinymce-editor/tinymce-editor.component';


@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    SungComponent,
    ArticlesComponent,
    ArticleListComponent,
    HomeMenuComponent,
    TinymceEditorComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot([{
      path: 'home',
      component: HomeComponent,
      children: [{
        path: 'menu',
        component: HomeMenuComponent
      }]
    }, {
      path: '',
      redirectTo: '/home',
      pathMatch: 'full'
    }, {
      path: 'hoosung',
      component: SungComponent
    }, {
      path: 'article/list',
      component: ArticleListComponent
    }, {
      path: 'articles',
      component: ArticlesComponent
    }, {
      path: 'editor',
      component: TinymceEditorComponent
    }])
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
